package com.fr.lintcode;

import java.util.Arrays;

public class Q1671 {

    /**
     * @param A: 
     * @return: nothing
     */
    public long playGames(int[] A) {
        // Write your code here
    	if(A == null || A.length == 1) {
    		return 0;
    	}
    	Arrays.sort(A);
    	long sum = 0;
    	long low = 0;
    	for(int a : A) {
    		sum += a;
    	}
    	long high = sum;
    	while(low <= high) {
    		long mid = (low + high) /2;
    		check(mid, A, sum);
    	}
    	return low;
    }
    
    private boolean check(long mid, int[] A, long sum) {
    	long count;
    	for(int a : A) {
    		
    	}
    	return false;
    }


}
